package com.bwie.controller;

import com.bwie.pojo.User;
import com.bwie.service.CourseService;
import com.bwie.service.IUserService;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author GaoYiJie
 * @Description
 * @Create 2025/3/12 10:17
 * @Version 1.0
 */
@RestController
@RequestMapping("/course/course")
public class CourseController {

    @Autowired
    CourseService courseService;

    @Autowired
    IUserService iuserService;

    /**
     * 分页查询课程列表
     * @param pageInfoVo
     * @return
     */
    @PostMapping("/getCourseByPage")
    public R getCourseByPage(@RequestBody PageInfoVo pageInfoVo){
        return courseService.getCourseByPage(pageInfoVo);
    }

    /**
     * 扣除费用
     * @param
     * @return
     */
    @PostMapping("/updateFee")
    public R updateFee(@RequestBody User user){
        return iuserService.updateFee(user);
    }
}
